package com.xiangxiao.rpan.authority.exception;

import com.xiangxiao.rpan.authority.constant.ResponseCode;

/**
 * @Projectname: MsgException
 * @Author: xiangxiao
 * @Email: 573768011@qq.com
 * @Data:2023/3/16 23:44
 */
public class MsgException extends RuntimeException {
  /**
   * 错误信息
   */
  private final String msg;

  /**
   * 错误码
   */
  private int errorCode = ResponseCode.RESULT_FAIL;

  public MsgException(String msg) {
    super(msg);
    this.msg = msg;
  }

  public MsgException(String msg, int errorCode) {
    super(msg);
    this.msg = msg;
    this.errorCode = errorCode;
  }


  @Override
  public String getMessage() {
    return msg;
  }

  public int getErrorCode() {
    return errorCode;
  }
}
